using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Cleverscape.UTorrentClient.WebClient;

namespace uTorrentNetClient.ModelDesign.Converter
{
    [ValueConversion(typeof(OptionValue), typeof(string))]
    public class OptionValueDisplayConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(string))
            {
                return null;
            }
            if (value is OptionValue)
            {
                OptionValue ValueToConvert = (OptionValue)value;
                switch (ValueToConvert)
                {
                    case OptionValue.NotAllowed:
                        return "";
                    case OptionValue.Disabled:
                        return "Aus";
                    case OptionValue.Enabled:
                        return "An";
                    default:
                        break;
                }
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
